var baseUrl='http://47.108.197.28';
function http(url){
    return new Promise ((resolve,reject)=>{
        wx.request({
            url: baseUrl+url,
            data: {},
            method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
            header: {'content-type':'application/json'}, // 设置请求的 header
            responseType:'text',
            dataType:'json',
            success: function(res){
                resolve(res)
            },
            fail: function() {
                reject(res)
            }
        })
    })
}
function getTop250Http(){
    return http("/move/top250")
}
function getMovieDetailHttp(id){
    return http(`/movieDatil?id=${id}`)
}
function getMusicHttp(offset){
    return  http(`:3000/top/playlist?offset=${offset}&limit=20`)

}
module.exports ={
    getTop250Http,
    getMovieDetailHttp,
    getMusicHttp
}